from django.http import HttpResponse


def lol(request):
    # 调用response对象
    response = HttpResponse("111")

    # 调用对象的 set_cookie() 函数
    response.set_cookie("dnf",  1 , max_age = 3600 * 24 * 14)

    # 读取cookie
    value = request.COOKIES.get('dnf')
    print(value)
    return response
